FROM golang:1.23.2

RUN  apt-get update -qq  

RUN  mkdir -p /app/www  &&  mkdir -p /app/bin && cd  /app 
ENV  TZ=Asia/Shanghai
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata/

WORKDIR /app

COPY . .

COPY lang/*  /usr/share/tesseract-ocr/5/tessdata/

RUN apt-get install -y -qq libtesseract-dev libleptonica-dev


RUN apt-get install  -y -qq \
  tesseract-ocr-eng \
  tesseract-ocr-deu \
  tesseract-ocr-jpn

ENV PATH=$PATH:/app/www/go/bin
ENV GOPATH=/app/www/go

RUN go env -w  GOPROXY=https://goproxy.cn,direct

CMD ["go", "run", "main.go"]




##
# docker run -it --name  golang  -d  golang